<% layout('/layouts/default.html', {title: '游泳馆订单管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('订单管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="${ctx}/settlementapply/settlementApply/settlementApplyCount" class="btn btn-default btnTool" title="${text('申请结算')}">${text('申请结算')}</a>

				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('natatoriumorder:natatoriumOrder:edit')){ %>
					<a href="${ctx}/natatoriumorder/natatoriumOrder/form" class="btn btn-default btnTool" title="${text('新增游泳馆订单')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${natatoriumOrder}" action="${ctx}/natatoriumorder/natatoriumOrder/listData?natatoriumInfoId=${cookie('natatoriumInfoId')}" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('支付单号')}：</label>
					<div class="control-inline">
						<#form:input path="payNumber" maxlength="150" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('订单号')}：</label>
					<div class="control-inline">
						<#form:input path="orderNum" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('支付时间')}：</label>
					<div class="control-inline">
						<#form:input path="payDate" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('核算验证码')}：</label>
					<div class="control-inline">
						<#form:input path="settlementCode" maxlength="150" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('商品类型')}：</label>
					<div class="control-inline">
						<#form:select path="natatoriumGoods.goodsType" dictType="goods_type" blankOption="true" class="width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('订单状态')}：</label>
					<div class="control-inline">
						<#form:select path="orderStatus" dictType="order_status" blankOption="true" class="width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('结算状态')}：</label>
					<div class="control-inline">
						<#form:select path="settlementStatus" dictType="settlement_status" blankOption="true" class="width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text('订单号')}', name:'orderNum', index:'a.order_num', width:150, align:"left"},
		{header:'${text('用户手机号')}', name:'payerPhone', index:'a.payer_phone', width:160, align:"left"},
		{header:'${text('商品')}', name:'natatoriumGoods.name', index:'ng.name', width:110, align:"left"},
		{header:'${text('单价')}', name:'natatoriumGoods.price', index:'ng.price', width:130, align:"left", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text('购买数量')}', name:'buyNumber', index:'a.buy_number', width:130, align:"left"},
		{header:'${text('订单金额')}', name:'shouldPay', index:'a.should_pay', width:130, align:"left", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text('下单时间')}', name:'createDate', index:'a.create_date', width:180, align:"left"},
		{header:'${text('支付方式')}', name:'payType', index:'a.pay_type', width:120, align:"left"},
		{header:'${text('支付时间')}', name:'payDate', index:'a.pay_date', width:180, align:"left"},
		{header:'${text('核算验证码')}', name:'settlementCode', index:'a.settlement_code', width:130, align:"left"},
		{header:'${text('订单状态')}', name:'orderStatus', index:'a.order_status', width:100, align:"left", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('order_status')}, val, '${text('未知')}', true);
		}},
		{header:'${text('结算状态')}', name:'settlementStatus', index:'a.settlement_status', width:150, align:"left", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('settlement_status')}, val, '${text('未知')}', true);
		}},
		{header:'${text('操作')}', name:'actions', align:"center", width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			actions.push('<a href="${ctx}/natatoriumorder/natatoriumOrder/details?id='+row.id+'" class="btn btnList btn-operation" title="查看详情">${text("详情")}</a>&nbsp;');
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>